package com.yang.newCustomersTransferBackProcess.dao;

import com.yang.newCustomersTransferBackProcess.pojo.CustomerAssignment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface CustomerAssignmentDao extends JpaRepository<CustomerAssignment, Integer>, JpaSpecificationExecutor<CustomerAssignment> {

    @Query(value = "select * from customer_assignment where adviser_id = ?1 and customer_id = ?2", nativeQuery = true)
    CustomerAssignment findCustomerAssignment(int adviserId, int customerId);
}
